package com.zqx.combination.client;

import com.zqx.combination.abcomponent.AbstractFile;
import com.zqx.combination.containercomponent.Folder;
import com.zqx.combination.leafcomponent.ImageFile;
import com.zqx.combination.leafcomponent.TextFile;
import com.zqx.combination.leafcomponent.VideoFile;

public class Client {

    public static void main(String[] args) {
        AbstractFile folderOne = new Folder("ZQX的资料");
        AbstractFile folderTwo = new Folder("图像文件");
        AbstractFile folderThree = new Folder("文本文件");
        AbstractFile folderFour = new Folder("视频文件");

        AbstractFile imgFileOne = new ImageFile("小龙女.jpg");
        AbstractFile imgFileTwo = new ImageFile("谢晓峰.jpg");
        AbstractFile imgTextOne = new TextFile("九阴真经.txt");
        AbstractFile imgTextTwo = new TextFile("乾坤大挪移.doc");
        AbstractFile videoFileOne = new VideoFile("天龙八部.rmvb");
        folderTwo.add(imgFileOne);
        folderTwo.add(imgFileTwo);
        folderThree.add(imgTextOne);
        folderThree.add(imgTextTwo);
        folderTwo.add(videoFileOne);
        folderOne.add(folderTwo);
        folderOne.add(folderThree);
        folderOne.add(folderFour);

        //从“ZQX的资料”节点开始进行杀毒操作
        folderOne.killVirus();

    }
}
